﻿/*
 * GNU GENERAL PUBLIC LICENSE v2
 * 
 * Developers: Alan Audette, Oguz Bastemur
 */
namespace SqlDatabaseBackup.Helper
{
    using System;
    using System.Collections.Generic;
    using System.Text;

    internal static class ToConsole
    {
        internal static StringBuilder htmlLog = new StringBuilder();

        internal static void RedText(string text)
        {
            WriteLine(text, ConsoleColor.Red);
        }

        internal static void GreenText(string text)
        {
            WriteLine(text, ConsoleColor.Green);
        }

        internal static void WriteLine(string text = "", ConsoleColor text_color = ConsoleColor.White)
        {
            Console.ForegroundColor = text_color;
            Console.WriteLine(text);
            if (text != "")
            {
                string color = text_color.ToString().ToLower();
                if (color == "white")
                    color = "black";
                htmlLog.Append("<p class='fnormal' style='color:" + color + ";'>" + text + "</p>");
            }
            if (text_color != ConsoleColor.White)
                Console.ResetColor();
        }
    }
}